export default {
    state: {
        totalPrice: 0,
        goodsList: [
            { name: "香蕉", price: 3.2, num: 0 },
            { name: "苹果", price: 2.2, num: 0 },
            { name: "鸭梨", price: 4.2, num: 0 },
            { name: "葡萄", price: 3.7, num: 0 }
        ],
    },
    setStateGoodsList() {
        for (let index = 0; index < this.state.goodsList.length; index++) {
            this.state.goodsList[index].num = 0;
        }
    },
    resetTotalPrice() {
        this.state.totalPrice = 0;
    }
}
